<?php

namespace App\Kuafu\Pay\Enum;

class PayCacheEnum
{
    private const PAY_CONFIG              = 'pay-config:';
    private const PAY_RESULT_OPERATE_LOCK = 'payResultOperateLock';

    /**
     * 店铺的支付配置
     * @param int $shopId
     * @param int $payChannel
     * @return string
     */
    public static function getPayConfig(int $shopId, int $payChannel): string
    {
        return sprintf(self::PAY_CONFIG . "%d:%d", $shopId, $payChannel);
    }

    /**
     * 支付结果操作-原子锁
     * @param string $payNo
     * @return string
     */
    public static function getPayResultOperateLock(string $payNo): string
    {
        return sprintf(self::PAY_RESULT_OPERATE_LOCK . '%s', $payNo);
    }
}
